<?php

use app\components\BaseGridView;
use app\helpers\UserHelper;
use app\models\GroupUser;
use yii\helpers\ArrayHelper;

/* @var $dataProvider */

?>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => NULL,
    'columns' => [
        'group_num',
        'phone',
        ['attribute' => 'role', 'value' => function(GroupUser $model){
            return ArrayHelper::getValue(UserHelper::$roles, $model['role']);
        }],
        ['attribute' => 'group_priority', 'value' => function(GroupUser $model){
            return ArrayHelper::getValue(UserHelper::$userPriority, $model['group_priority']);
        }],
        'create_time:datetime',
        [
            'class' => 'app\components\BaseActionColumn',
            'template' => '{delete}',
        ]
    ],
]); ?>
